public class Draw {
    private int height;
    private int i;
    private int j;

    public Draw(int h) {
        this.height = h;
    }

    public void drawTriangle() {
        for (i = 1; i <= height; i++) {
            for (j = 1; j <= i; j++) {
                System.out.print("*");
            }
            System.out.println();
        }
    }

    public void drawRectangle() {
        for (i = 1; i <= height; i++) {
            for (j = 1; j <= 3; j++) {
                System.out.print("*");
            }
            System.out.println();
        }
    }

    public void drawSquare() {
        for (i = 1; i <= height; i++) {
            for (j = 1; j <= height; j++) {
                System.out.print("*");
            }
            System.out.println();
        }
    }

    public void drawParallelogram() {
        for (i = 1; i <= height; i++) {
            for (j = 2; j <= i; j++) {
                System.out.print(" ");
            }
            for (j = i + 1; j <= i + 4; j++) {
                System.out.print("*");
            }
            System.out.println();
        }
    }

    public static void main(String[] args) {
        Draw drawObj = new Draw(5);
        drawObj.drawTriangle();
        drawObj.drawRectangle();
        drawObj.drawSquare();
        drawObj.drawParallelogram();
    }
}
